﻿module Utilities

open System
open Microsoft.Xna.Framework
open Microsoft.Xna.Framework.Graphics

type Random
  with
    member this.NextFloat with get() = this.NextDouble() |> float32

type Texture2D
  with
    member this.Size with get() = Vector2(this.Width |> float32, this.Height |> float32)

let random = new Random()

let lerp (a:float32) (x:float32<'u>) (y:float32<'u>) = x * a + y * (1.0f - a)
let random_lerp : float32<'u> -> float32<'u> -> float32<'u> = fun x y -> lerp (random.NextFloat) x y

